package servlet;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;

public class WebSCAttributeListener implements ServletContextAttributeListener {

	@Override
	public void attributeAdded(ServletContextAttributeEvent event) {
		ServletContext context=event.getServletContext();
		
		String name=event.getName();
		Object value=event.getValue();
		
		System.out.println(context+"范围内添加 name："+name+" 值为："+value+" 的属性");

	}

	@Override
	public void attributeRemoved(ServletContextAttributeEvent event) {
		ServletContext context=event.getServletContext();
		
		String name=event.getName();
		Object value=event.getValue();
		
		System.out.println(context+"范围内 name："+name+" 值为："+value+" 的属性被移除了");

	}

	@Override
	public void attributeReplaced(ServletContextAttributeEvent event) {
		ServletContext context=event.getServletContext();
		
		String name=event.getName();
		Object value=event.getValue();
		
		System.out.println(context+"范围内 name："+name+" 值为："+value+" 的属性被替换了");

	}

}
